package
{
	import flash.display.Sprite;
	
	import kr.as3.component.ui.DragFrame;
	import kr.as3.component.ui.DragFrameEvent;

	public class DragFrameSolution extends Sprite
	{
		// things on stage.
		public var image: Sprite;
		public var dragFrame: DragFrame;
		
		public function DragFrameSolution()
		{
			this.dragFrame.setDragArea( this.image.getBounds( this ) );
			this.dragFrame.addEventListener( DragFrameEvent.DRAG_MARGIN, marginListener );
		}
		
		private function marginListener( e: DragFrameEvent ): void
		{
			this.image.x = e.margin.x;
			this.image.y = e.margin.y;
		}
	}
}
